# 监控系统资源使用情况
while true; do
    echo "=== $(date) ==="
    echo "CPU Usage: $(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}')%"
    echo "Memory Usage: $(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')"
    echo "TCP Connections: $(netstat -ant | wc -l)"
    echo "Proxy Connections: $(netstat -ant | grep 2510 | wc -l)"
    echo "Active Sessions: $(ss -s | grep estab | awk '{print $2}')"
    sleep 5
done